#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e6 + 5;

int n, m;
int a[N], b[N];
unordered_map<int, int> pos;
struct Node {
  int l, r;
  int id;
  bool operator<(const Node& b) const { return r < b.r; }
} c[N];
int sum[N << 2];
int ans[N];
void pushup(int p) { sum[p] = sum[p << 1] ^ sum[p << 1 | 1]; }
void update(int x, int v, int p, int l, int r) {
  if (l == r) {
    sum[p] = v;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    update(x, v, p << 1, l, mid);
  else
    update(x, v, p << 1 | 1, mid + 1, r);
  pushup(p);
}
int query(int L, int R, int p, int l, int r) {
  if (L <= l && R >= r) return sum[p];
  int mid = (l + r) >> 1;
  int res = 0;
  if (L <= mid) res ^= query(L, R, p << 1, l, mid);
  if (R > mid) res ^= query(L, R, p << 1 | 1, mid + 1, r);
  return res;
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  rep(i, 1, n) cin >> a[i];
  rep(i, 1, n) b[i] = b[i - 1] ^ a[i];
  cin >> m;
  rep(i, 1, m) c[i].id = i, cin >> c[i].l >> c[i].r;
  sort(c + 1, c + m + 1);
  int r = 0;
  rep(i, 1, m) {
    while (r < c[i].r) {
      ++r;
      int l = pos[a[r]];
      if (l) update(l, 0, 1, 1, n);
      update(r, a[r], 1, 1, n);
      pos[a[r]] = r;
    }
    int x = b[c[i].r] ^ b[c[i].l - 1];
    int y = query(c[i].l, c[i].r, 1, 1, n);
    int z = x ^ y;
    ans[c[i].id] = z;
  }
  rep(i, 1, m) cout << ans[i] << endl;
  return 0;
}